<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="号源方案名称">
              <a-input placeholder="请输入号源方案名称" v-model="queryParam.name" />
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

<!--          <a-divider type="vertical" />-->
<!--          <a @click="handleDetail(record)">详情</a>-->
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
          </a-popconfirm>
        </span>

      </a-table>
    </div>

    <time-config-modal ref="modalForm" @ok="modalFormOk"></time-config-modal>
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import TimeConfigModal from './modules/TimeConfigModal'

export default {
  name: 'OrdMealConfigList',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    JDictSelectTag,
    TimeConfigModal
  },
  data () {
    return {
      description: '号源时段设置',
      // 表头
      columns: [
        {
          title:'号源方案名称',
          align:"center",
          dataIndex: 'name'
        },
        {
          title:'就诊分钟数(分钟)',
          align:"center",
          dataIndex: 'minute'
        },
        {
          title:'时段(多少分钟为一个时段)',
          align:"center",
          dataIndex: 'timeSpan'
        },
        {
          title:'可预约人数',
          align:"center",
          dataIndex: 'allowQty'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align:"center",
          fixed:"right",
          width:147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: "/his/time/config/list",
        delete: "/his/time/config",

      },
      dictOptions:{},
    }
  },
  created() {
  },
  computed: {

  },
  methods: {
    initDictConfig(){
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>